// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
var objA = {};
objA.__defineGetter__('gimmeFive', function() {
	return 5;
});

// not work
objA.gimmeFive = function() {
	return 6;
};
objA.gimmeSix = function() {
	return 6;
};
console.log(objA.gimmeFive); // 5
console.log(objA.gimmeSix()); // 5



// Using the get operator
var o2 = { get gimmeFive() { return 5; } };
console.log(o2.gimmeFive); // 5

// Using Object.defineProperty
var o1 = {};
Object.defineProperty(o1, 'gimmeFive', {
  get: function() {
    return 5;
  }
});
console.log(o1.gimmeFive); // 5
